package com.antdesignbackend.backend.mapper;

import com.antdesignbackend.backend.entity.Roles;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

@Component
public interface RolesMapper extends BaseMapper<Roles> {
    @Select("select * from Roles  where RoleID=(select min(RoleID) from Roles  where RoleID>#{RoleID})")
    Roles selectNextIdByRoleid(@Param("RoleID") int RoleID);

    @Select("select * from Roles where RoleID=(select max(RoleID) from Roles where RoleID<#{RoleID}) ")
    Roles selectLastIdByRoleid(@Param("RoleID") int RoleID);
}
